package com.cqie.config;

import com.cqie.filter.CrossFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Collections;

@Configuration
public class FilterConfig {
    @Bean
    public FilterRegistrationBean crossFilterBean() {
        FilterRegistrationBean registration = new FilterRegistrationBean();
        registration.setName("crossFilter");
        registration.setFilter(new CrossFilter());
        registration.setUrlPatterns(Collections.singleton("/*"));
        registration.setOrder(1);
        return registration;
    }
}